import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router';
import { LocalStorageService } from '../../service/localStorageService/local-storage.service';


// 验证刷新令牌是否过期
@Injectable({
  providedIn: 'root'
})
export class CheckoutRefreshTokenGuard implements CanActivate {
  constructor(
    private router: Router,
    public localStorage: LocalStorageService,
  ) { }
  canActivate() {
    // console.log("刷新令牌");
    
    // var token: any = this.localStorage.getItem('token');
    // if (token === null) {
    //   this.router.navigate(['/login']);
    //   return;
    // }
    // if (token.flag === false) {
    //   return true;
    // } else {
    //   this.router.navigate(['/login']);
    // }
    return true;
  }
}
